UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y1G+iZIf/754VsG2UP33USLRut+jA8WpmRxKIQFEbzU=' 
WHERE 
  key_id = '725becaf0f4369b9b8dd95cd63b60a18cd8a5a9bb369caf3dfe598de132cc157' 
  AND (
    token = 'Y1G+iZIf/754VsG2UP33USLRut+jA8WpmRxKIQFEbzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021