UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u+yvsTHG06HtGUsGjXNMeN77POa4SSB0hep7Kt5J5VU=' 
WHERE 
  key_id = 'd69ee3846b02d4a7a08f7db4cd045e2d5d3922ed887954d0127ee65c1d55df98' 
  AND (
    token = 'u+yvsTHG06HtGUsGjXNMeN77POa4SSB0hep7Kt5J5VU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059