UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q+11ihDUehZCGo4bLinP+hx6M3utk5vRyb/PXNU7/7g=' 
WHERE 
  key_id = 'd57f183d5e6764bada0ebd93695344237686763ff3b374b1268283c86d21eafc' 
  AND (
    token = 'q+11ihDUehZCGo4bLinP+hx6M3utk5vRyb/PXNU7/7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013