UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+ySo1IlVYRjNB4mY1b8tKI0E30kAQ8J1dGXPUJ7PRT0=' 
WHERE 
  key_id = '6bf23a702f96d59ae8e78c6d050f7b8b2378ee145bb068e18cbec4ef615f4e06' 
  AND (
    token = '+ySo1IlVYRjNB4mY1b8tKI0E30kAQ8J1dGXPUJ7PRT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056