UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CgQboiT2FyXl8LBHdvfnK0NV+uPyl7nb8ZlDaEgCPTA=' 
WHERE 
  key_id = '55fdef2bd1b8d654fb1cb63e6515a9da4bb4947c409576bf08f3e56e8cf81da9' 
  AND (
    token = 'CgQboiT2FyXl8LBHdvfnK0NV+uPyl7nb8ZlDaEgCPTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031