UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uA/2EMUPbWdix/Ecq1UwXELW7jLnOE6CukLPe7xi70U=' 
WHERE 
  key_id = 'ef86dc9309a27a7e486fa320c52019b7ba449b71e9ff4050b17100f45426c5b5' 
  AND (
    token = 'uA/2EMUPbWdix/Ecq1UwXELW7jLnOE6CukLPe7xi70U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032