UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4/UXqFnrMVPweX7C+Jmhg97EuNmGnxYI/pe69rQcKLI=' 
WHERE 
  key_id = '0c817e368c7d01d693330df9a8ad1f2f82978db95895fa9a05c0ce1ffe7fe388' 
  AND (
    token = '4/UXqFnrMVPweX7C+Jmhg97EuNmGnxYI/pe69rQcKLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00085