UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eMMh6G6YXXoVwQ7lDdxZvGLlnRYI4cHOuja2t+OYpJg=' 
WHERE 
  key_id = '4c8ea3f19bdbe6344521f7d5b5a574cb9cae9417e1ae0211ae2c4824980149bf' 
  AND (
    token = 'eMMh6G6YXXoVwQ7lDdxZvGLlnRYI4cHOuja2t+OYpJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025