UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/H68Xl53z3vUteE2A83uU10pI+N/DM5+noV4XXpFg3E=' 
WHERE 
  key_id = '80f9061be2cb1e0307f7623a5d6fc8604b5018eceb7977f823afedd168a75050' 
  AND (
    token = '/H68Xl53z3vUteE2A83uU10pI+N/DM5+noV4XXpFg3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039