UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vlJoR5m4EqMaeaWI/UlHsop0lyAkhk9HmvFHTYdVPI4=' 
WHERE 
  key_id = 'c452998a8b805542544044be0f70d6472b8178c0db548761e5281af36431e52d' 
  AND (
    token = 'vlJoR5m4EqMaeaWI/UlHsop0lyAkhk9HmvFHTYdVPI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023