UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WDYVuAVjimWsZFS0EWv2ks5GYf8E1WnBEW7HOP9P1i0=' 
WHERE 
  key_id = '11221bd37023a7a82d15935a3ad773f46b952fca8c88ee1c7e3f228f5310ef53' 
  AND (
    token = 'WDYVuAVjimWsZFS0EWv2ks5GYf8E1WnBEW7HOP9P1i0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020