UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TM9i9GHr/1CGU17WdwgIiNgw+IqhjUQBABgFh6mPzCk=' 
WHERE 
  key_id = '1efeaf7764b50887a0ad061c333a2bed89a5e13e071ebcbb9211116062480e73' 
  AND (
    token = 'TM9i9GHr/1CGU17WdwgIiNgw+IqhjUQBABgFh6mPzCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019