UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8hoKDIV46mXgjls04SleYCGEwBYeusSacH4YPzE/pCs=' 
WHERE 
  key_id = '16f96c37ac347438722f46f7f341ca02a431eab0608e39dcd9be8d0789b73f8c' 
  AND (
    token = '8hoKDIV46mXgjls04SleYCGEwBYeusSacH4YPzE/pCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033