UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JRzmGQTuemdpyfDQZnsGsSpq6677VAC/vK2dtTEsu+U=' 
WHERE 
  key_id = '0bfadf42ea36ed9b07f0290c414d08764bfe960d0c70eeb75490d9008b3a17d1' 
  AND (
    token = 'JRzmGQTuemdpyfDQZnsGsSpq6677VAC/vK2dtTEsu+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048