UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F7WwRpRDYqGNZOKNw+PYnE1w4+HWIAanes5BDyycwUo=' 
WHERE 
  key_id = '53d42994c3c09a6e06c0665f10ccff34b59ff6b879c21ab47a05357158f42b7f' 
  AND (
    token = 'F7WwRpRDYqGNZOKNw+PYnE1w4+HWIAanes5BDyycwUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032