UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ppOxeVQ3FcLV2n9Hvf4ipoDIa9CigbssZyrTjlViN0U=' 
WHERE 
  key_id = '623bceffd2149a833d051dac354bfce13084e488940e94d1c76d10facd0b0bd4' 
  AND (
    token = 'ppOxeVQ3FcLV2n9Hvf4ipoDIa9CigbssZyrTjlViN0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036