UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k5k3cHaQc9eaXuvx8D7Xd6Kq9xVxdqvFJTPhHl3uBoQ=' 
WHERE 
  key_id = '042854a627e6f4ec151681fb53bb8740ab6dd3acd2e18bc0b781a3a10391ba04' 
  AND (
    token = 'k5k3cHaQc9eaXuvx8D7Xd6Kq9xVxdqvFJTPhHl3uBoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033