UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fDa96QVnzwNQpIBr63Vwu5WHbHKyIPvk2Z97YMP9uoM=' 
WHERE 
  key_id = '04ea4f85d76c8fcdaad717d764431dacd0960534ebed2a9cd4967ac303c72a73' 
  AND (
    token = 'fDa96QVnzwNQpIBr63Vwu5WHbHKyIPvk2Z97YMP9uoM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021