UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Bi0N2ZE/zkEpLQ+lxZWz2Dc3Z0JsZXKT+vCPyT0ExY=' 
WHERE 
  key_id = 'd7702a07d9442968601eb6d899b851fba4cead32a593fa95fcc5e63cbe2028d5' 
  AND (
    token = '7Bi0N2ZE/zkEpLQ+lxZWz2Dc3Z0JsZXKT+vCPyT0ExY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025