UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MpySRLejySI9RFM8n1yIojVarY3ZPDJ91aeXWj34S7Y=' 
WHERE 
  key_id = '810a968f15dd1aeb467d5958081f62e2d42da2dd6d66ed8def0a4023a327e9ae' 
  AND (
    token = 'MpySRLejySI9RFM8n1yIojVarY3ZPDJ91aeXWj34S7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016