UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LHV8ISDu9uo7zz8C8Xrfp57OAmo53EWNnfhVpYM9d2c=' 
WHERE 
  key_id = '02b461b6771329eecae98f1a4fca2b856c5e8b3684fcaa81d2ef61398d8a314b' 
  AND (
    token = 'LHV8ISDu9uo7zz8C8Xrfp57OAmo53EWNnfhVpYM9d2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016