UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VjbgflCJ6YGR1VG/zhEVbknAT/aFTRsnKAsdKYjYIVo=' 
WHERE 
  key_id = 'bc9ad5ee6383d9d5b59a73d49ad4217e8038b5f0668153a548fb24844132c848' 
  AND (
    token = 'VjbgflCJ6YGR1VG/zhEVbknAT/aFTRsnKAsdKYjYIVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027