UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zBfxA2PtmMsFVBr65IJ6BEwjW2jDozy1LJ6vDTJBehQ=' 
WHERE 
  key_id = '2710fafb86c3f4043a07213b6b565a66ecc1370299ef6ee2ec186c0b5f4d153c' 
  AND (
    token = 'zBfxA2PtmMsFVBr65IJ6BEwjW2jDozy1LJ6vDTJBehQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022