UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CfiA1gnobDwah3yOkoeJtP91VwYLd6x+/cZDpJ6qXyA=' 
WHERE 
  key_id = '354eb894ff1645128382eb4bc77c56b2367329e1c480b8127b3c403e3df298c5' 
  AND (
    token = 'CfiA1gnobDwah3yOkoeJtP91VwYLd6x+/cZDpJ6qXyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017