UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DHBRMxHQTpYJ9YjbFWk/EL5PRnBigBCyEPdRmDHzPnE=' 
WHERE 
  key_id = '97d519f5d7e363e9da4ede5cbfec8d2bff8982b39c0c57aa43033194439ff767' 
  AND (
    token = 'DHBRMxHQTpYJ9YjbFWk/EL5PRnBigBCyEPdRmDHzPnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031