UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eNsytpH8AdFJ7AzXgExeutWjLLGWFabGXCR4ezqDAyE=' 
WHERE 
  key_id = '1fe4f90ffea8568afbc311a346b9b69da1427451b8e118ffb41347a3fa46e481' 
  AND (
    token = 'eNsytpH8AdFJ7AzXgExeutWjLLGWFabGXCR4ezqDAyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026