UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pWQ3yLLSc/+Dqqt88VQSljIc0tjeARNyQ2l4EYo2LoY=' 
WHERE 
  key_id = '05d7b62f3d9227b0c91018861f7cd7db0960e9ec1e5dbb5732db236f4049b3a1' 
  AND (
    token = 'pWQ3yLLSc/+Dqqt88VQSljIc0tjeARNyQ2l4EYo2LoY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037