UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LLMxy71JWr8RxDuWVjavzY80bwIipO2H9aTnvwwPs64=' 
WHERE 
  key_id = '376c7e07ed00c1a77ea736a26917ced3f7b9727507f5c68b8468c5493bbd525b' 
  AND (
    token = 'LLMxy71JWr8RxDuWVjavzY80bwIipO2H9aTnvwwPs64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047