UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G2unPN6F8IxE+9bhqx7bmCUyu9FLjK+6zEISnjadBFo=' 
WHERE 
  key_id = 'fa7ba50b27aaa19b6c5796a20c302f355ded36718df6aba5fc9dd5cbb9a3400d' 
  AND (
    token = 'G2unPN6F8IxE+9bhqx7bmCUyu9FLjK+6zEISnjadBFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046