UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wI2bYRER72Iyq8/+puGhjbm5gisabDMlIxfyQy4liIA=' 
WHERE 
  key_id = '3bb275ed6e6a2a0929253d3ab04d9b5112d0213af7fd7204a9cff5b607cb0518' 
  AND (
    token = 'wI2bYRER72Iyq8/+puGhjbm5gisabDMlIxfyQy4liIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053