UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jUxDTXv/N/VP+0rbXG7/k+d98PQSGX4DZMPXJyAtH2E=' 
WHERE 
  key_id = 'd0105e5daaef7a93e91045ea7fe7b5b9fcb6a6452acf104576c7e35d5cc6313d' 
  AND (
    token = 'jUxDTXv/N/VP+0rbXG7/k+d98PQSGX4DZMPXJyAtH2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032