UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yis0CByrrfXihkd7mwEIxehEDjHNgWsu6y6SlqkLuAg=' 
WHERE 
  key_id = '6bac6e6ce46b8bf56a5bb385991ac7eb4da03784f0ad8dea82a51fbb616f4cd9' 
  AND (
    token = 'yis0CByrrfXihkd7mwEIxehEDjHNgWsu6y6SlqkLuAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049