UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VVkBbOcK+bwiVAG2WW/Y9OBDShhleBxEvyMgcIJIWAo=' 
WHERE 
  key_id = '1f2be7b41778c94009ba023b31e4b68dfda660511cf880dfe51ebce093273aa9' 
  AND (
    token = 'VVkBbOcK+bwiVAG2WW/Y9OBDShhleBxEvyMgcIJIWAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032