UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XL1pD600W6eNVbC/ti9n8vtzKmqAD3ye+KtKjLXKNmg=' 
WHERE 
  key_id = '43afaeaaee13e8e172bfdc121bd0434acf3f4da7e489bc6bb595444a90ff9c40' 
  AND (
    token = 'XL1pD600W6eNVbC/ti9n8vtzKmqAD3ye+KtKjLXKNmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019