UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kt2Y/zyJ2ps3TGsvH79s/Q5LWlfhG7+Ma+r6CeS73l4=' 
WHERE 
  key_id = 'adfeb768f1a4e17db9d1c74db38824189cb2d67cbb58e3f8f8ec363a9db71f75' 
  AND (
    token = 'kt2Y/zyJ2ps3TGsvH79s/Q5LWlfhG7+Ma+r6CeS73l4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038