UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/sY9RJOypf78yT8ZdwD7aX1myR/pdjeadrEokGlk9oI=' 
WHERE 
  key_id = 'bdd25695e54c0e2f5f94a43b5b0617b8b30dde0b71445c00ab6ad7ee8dbffee8' 
  AND (
    token = '/sY9RJOypf78yT8ZdwD7aX1myR/pdjeadrEokGlk9oI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046