UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JB4M8Tz+ntNh1wZtzoKVR/NSDnYtFBPS/d2guX/K4yY=' 
WHERE 
  key_id = '61ec2884fda16bbaaa62ee6171bf183fc1038a4ab06681b3164c3999aa91f0df' 
  AND (
    token = 'JB4M8Tz+ntNh1wZtzoKVR/NSDnYtFBPS/d2guX/K4yY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038